#include <cstdio>
#define _CRT_SECURE_NO_WARNINGS
using namespace std;
typedef char ElemType;
typedef enum { Child, Thread }PointTag;
typedef struct BinaryNode {
	struct BinaryNode* pLeftChild;
	struct BinaryNode* pRightChild;
	PointTag tagLeft;
	PointTag tagRight;
	ElemType value;
}BiNode, *BiTree;
BiTree pre;
void CreateBinaryTree(BiTree* biTree) {
	ElemType value;
	scanf("%c", &value);
	if (value == ' ') {
		(*biTree) = nullptr;
	}
	else {
		(*biTree) = new BiNode;
		(*biTree)->value = value;
		(*biTree)->tagLeft = Child;
		(*biTree)->tagLeft = Child;
		CreateBinaryTree(&(*biTree)->pLeftChild);
		CreateBinaryTree(&(*biTree)->pRightChild);
	}
}
void InTreading(BiTree* biTree) {
	if (biTree) {
		InTreading(&(*biTree)->pLeftChild);
		if (!(*biTree)->pLeftChild) {
			(*biTree)->pLeftChild = pre;
			(*biTree)->tagLeft = Thread;
		}
		if (!(*biTree)->pRightChild) {
			(*biTree)->pRightChild = *biTree;
			(*biTree)->tagRight = Thread;
		}
		InTreading(&(*biTree)->pRightChild);
	}
}
void CreatePreNode(BiTree* biTree,BiTree* biPreNode) {
	*biPreNode = new BiNode;
	if (biTree) {
		(*biPreNode)->
	}
}
int main() {

	return 0;
}